{include file="styles/header.tpl"}
<link rel="stylesheet" media="screen,projection" type="text/css" href="{$smarty.const.HOST_STATIC}/admin/css/dragontool.fix.css" />
<div id="content" class="content"
	 {include file="forecast/index.windows.resize.tpl"}
	 >
	<h1>
		{if $arrArchiveLog} Archive Data | {$arrArchiveLog.createdate}
		{else}Current Forecast
		{/if}
	</h1>
	<div class ="forcasts-btn-confirm">
		<h2>
				({$intTotal} record{if $intTotal>2}s{/if})
				{if $intTotal>0}
				|
				<a href="{$smarty.const.HOST_ADMIN}/archive/export/?n={$strTableName}">Export</a>
				{/if}
		</h2>
	</div>
	<div class="forcasts-color" >
		  {include file="forecast/index.color.tpl"}
	</div>
	<div class="clearfix"></div>
	{include file="forecast/index.addcolumn.tpl"}
	<div class="data-content" class="clearfix">
		<div class="head">
			{include file="archive/index.result.tpl"}
		</div>
	    {if $arrResult !=null}
		<div class="content">
			{include file="archive/index.result.tpl"}
		</div>
		{/if}
	</div>
	
	{include file="styles/paginator.tpl"}
	<form method="get" name="frmSearch">
		<input type="hidden" name="is" value="{$intStatus}" />
		<input type="hidden" name="li" value="{$intItemOnPerPage}" />
	</form>
</div>
{literal}
<script type="text/javascript">
	function wait(id, v)
	{
		return;
		var e	= $('#w_'+id);
		var html= '<img src="img/wait.gif" />';
		if(v=='done'){
			html= '<img src="img/ok.gif" />';
		}
		e.html(html);
	}
	
	function update_field(i, f)
	{
		var v	= $('#'+f+'_'+i).val();
		
		var idW	= f+'_'+i;
		wait(idW, 'wait');
		
		$.post
		(
			HOST + '/{/literal}{$strType}{literal}/update-field/',
			{
				'i'	: i,
				'f'	: f,
				'v'	: v
			},
			function(data)
			{
				var idW	= f+'_'+i;
				wait(idW, 'done');
			},
			'json'
		);
	}
	
	
	function do_confirm()
	{
		var msg	= 'Confirm the forecast data. Are you sure?';
		if( confirm(msg) )
		{
			window.location.href	= HOST + '/forecast/confirm';
		}
	}
	
	function do_deleteColumn(v)
	{
		var msg	= 'Remove the column ['+v+']. Are you sure?';
		if( confirm(msg) ){
			showWaiting();
			$.post
			(
				HOST_ADMIN + '/forecast/drop-column',
				{
					'c'	: v
				},
				function(data)
				{
					window.location.href = window.location.href;
				},
				'json'
			);
		}
	}
</script>
{/literal}
<div id="currenttab" class="category_previous_forecast" style="display: none;">
{include file="styles/footer.tpl"}